﻿<a href="#" class="session-panel-icon">
    @if(Request.IsAuthenticated) 
    {
        @:@HttpContext.Current.User.Identity.Name
    }
    else {
        @:Entrar
    }
</a>
<div class="session-panel" style="display:none">
    <span>
    @if(Request.IsAuthenticated) 
    {
        GDoc.Web.GDocPrincipal principal = User as GDoc.Web.GDocPrincipal;
            
        @:@Html.ActionLink("Cerrar Sesión", "LogOff", "User")<br />
        @:@Html.ActionLink("Cambiar Cuenta", "Select", "Account")<br />
        @:@Html.ActionLink("Perfil", "Profile", "User")<br />

        if (principal != null && principal.GIdentity.User.Theme == "light")
        {
             @:@Html.ActionLink("Cambiar Tema", "ChangeTheme", "User")<br />
        }
        else
        {
             @:@Html.ActionLink("Cambiar Tema", "ChangeTheme", "User")<br />
        }
    }
    else
    {
        @:@Html.ActionLink("Iniciar Sesión", "LogOn", "User")<br />
    }
    @Html.ActionLink("Ayuda", "Help", "Home")<br />
    @Html.ActionLink("Acerca de", "About", "Home")
    </span>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $(".session-panel-icon").hover(
            function () {
                displaySessionPanel();
            },
            function () {
                displaySessionPanel();
            }
        );
        $(".session-panel").hover(
            function () {
                displaySessionPanel();
            },
            function () {
                displaySessionPanel();
            }
        );
    });

    function displaySessionPanel() {
        if ($(".session-panel").css('display') == 'block')
            $(".session-panel").hide();
        else
            $(".session-panel").show();
    }
</script>